from django.contrib import admin

# Register your models here.
from .models import SKU, GoodsCategory, GoodsChannelGroup, GoodsChannel, Brand, SPU, SKUImage, SPUSpecification, \
    SpecificationOption, SKUSpecification, GoodsVisitCount


@admin.register(GoodsCategory)
class GoodsAdmin(admin.ModelAdmin):
    # 显示列表
    list_display = ['id', 'name', 'parent']


@admin.register(GoodsChannelGroup)
class GoodsAdmin(admin.ModelAdmin):
    # 显示列表
    list_display = ['id', 'name']


@admin.register(GoodsChannel)
class GoodsAdmin(admin.ModelAdmin):
    # 显示列表
    list_display = ['id', 'group', 'category', 'url', 'sequence']


@admin.register(Brand)
class GoodsAdmin(admin.ModelAdmin):
    # 显示列表
    list_display = ['id', 'name', 'logo', 'first_letter']


@admin.register(SPU)
class GoodsAdmin(admin.ModelAdmin):
    # 显示列表
    list_display = ['id', 'name', 'brand', 'category1', 'category2', 'category3', 'sales', 'comments', 'desc_detail',
                    'desc_pack', 'desc_service']


@admin.register(SKU)
class GoodsAdmin(admin.ModelAdmin):
    # 显示列表
    list_display = ['id', 'name', 'create_time', 'update_time', 'price',
                    'cost_price', 'market_price', 'stock', 'sales', 'comments']

@admin.register(SKUImage)
class GoodsAdmin(admin.ModelAdmin):
    # 显示列表
    list_display = ['id', 'sku', 'image']

@admin.register(SPUSpecification)
class GoodsAdmin(admin.ModelAdmin):
    # 显示列表
    list_display = ['id', 'spu', 'name']

@admin.register(SpecificationOption)
class GoodsAdmin(admin.ModelAdmin):
    # 显示列表
    list_display = ['id', 'spec', 'value']


@admin.register(SKUSpecification)
class GoodsAdmin(admin.ModelAdmin):
    # 显示列表
    list_display = ['id', 'sku', 'spec', 'option']


@admin.register(GoodsVisitCount)
class GoodsAdmin(admin.ModelAdmin):
    # 显示列表
    list_display = ['id', 'category', 'count', 'date']


